def parse_json(json, length='km'):
    """
        parse uber api result json
        Args:
            json (json) - result requested json
            length (str) - type of length values to return - miles, kilometers or meters (mi/km/m)
        Returns:
            price, distance_estimation, time_estimation
    """

    length_dict = {'mi':1, 'km':1.60934, 'm':1609.34}

    if json is None:
        return -1, -1, -1
    else:
        if length not in length_dict.keys():
            mult = 1
        else:
            mult = length_dict[length]

        distance_estimation = json['trip']['distance_estimate'] * mult
        time_estimation = json['trip']['duration_estimate']
        price = json['fare']['value']

        return price, distance_estimation, time_estimation