     }
 }
 
-enum OpenWeatherRouter: URLRequestConvertible {
-    case getCurrentWeatherForLocation(CGPoint)
+enum WeatherUndergroundRouter: URLRequestConvertible {
     
-    private static let baseURLString = "http://api.openweathermap.org/data/2.5/"
-    private static let APPID = "&APPID=b22cafbf884cf6f6ff7f56cbe1f4c20a"
+    case getCurrentWeatherForLocation(CGPoint), getYesterdaysWeatherForLocation(CGPoint)
+    
+    private static let baseURLString = "http://api.wunderground.com/api/9caa09c5d1399971/"
+    
+    
+    //for historical: dailysummary - 1st object - meantempi
     
     
     var method: HTTPMethod {

    var path: String {
        switch self {
        case .getCurrentWeatherForLocation(_):
            return "weather"
        }
    }
    
    func asURLRequest() throws -> URLRequest {
        let url = try OpenWeatherRouter.baseURLString.asURL()
        let urlWithPath = url.appendingPathComponent(path)
        var params = ["APPID": "b22cafbf884cf6f6ff7f56cbe1f4c20a"]
        
        var urlRequest = URLRequest(url: urlWithPath)
        urlRequest.httpMethod = method.rawValue
        
        switch self {
        case let .getCurrentWeatherForLocation(location):
            params["lat"] = "\(location.x)"
            params["lon"] = "\(location.y)"
        }
        
        print("url: \(urlRequest.url?.absoluteString)")
        urlRequest = try URLEncoding.default.encode(urlRequest, with: params)
        return urlRequest
    }
}


struct API {
    static func getCurrentWeatherForLocation(_ location: CGPoint) {
       Alamofire.request(WeatherUndergroundRouter.getCurrentWeatherForLocation(location)).responseJSON { response in
            if let JSON = response.result.value {
                print("JSON: \(JSON)")
            }
