def results(query)
      return [] unless doc = fetch_data(query)
      return doc["results"][0]['locations'] if doc['info']['statuscode'] == 0 # A successful geocode call

      messages = doc['info']['messages'].join

      case doc['info']['statuscode']
      when 400 # Error with input
        raise_error(Geocoder::InvalidRequest, messages) ||
          Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
      when 403 # Key related error
        raise_error(Geocoder::InvalidApiKey, messages) ||
          Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
      when 500 # Unknown error
        raise_error(Geocoder::Error, messages) ||
          Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
      end
      []
    end
def results(query)
      return [] unless doc = fetch_data(query)
      return doc["results"][0]['locations'] if doc['info']['statuscode'] == 0 # A successful geocode call

      messages = doc['info']['messages'].join

      case doc['info']['statuscode']
      when 400 # Error with input
        raise_error(Geocoder::InvalidRequest, messages) ||
          Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
      when 403 # Key related error
        raise_error(Geocoder::InvalidApiKey, messages) ||
          Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
      when 500 # Unknown error
        raise_error(Geocoder::Error, messages) ||
          Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
      end
      []
    end
http://www.mapquestapi.com/geocoding/status_codes.html
 http://open.mapquestapi.com/geocoding/status_codes.html