         task.resume()
     }
  
-    // MARK: - Location Manager Delegate
- 
-    public func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
- 
-        let location = locations.last
-        let timeSinceLastUpdate = location?.timestamp.timeIntervalSinceNow
- 
-        // Check for cached location and invalid measurement
-        guard fabs(timeSinceLastUpdate!) < 5.0 && location?.horizontalAccuracy > 0.0 else {
-            return
-        }
-        
-        manager.stopUpdatingLocation()
-        
-        let currentLocation = CLLocation(latitude: self.latitude, longitude: self.longitude)
-        let lastUpdate = NSUserDefaults.standardUserDefaults().objectForKey(kLastLocationUpdate) as? NSDate
-        
-        guard locationCompletionHandlers.count > 0 else {
-            return
-        }
-        
-        while locationCompletionHandlers.count > 0 {
-            
-            guard let completionHandler = locationCompletionHandlers.removeFirst() else {
-                return
-            }
-            
-            let longitude = location?.coordinate.longitude, latitude = location?.coordinate.latitude
-            
-            self.longitude = longitude!
-            self.latitude = latitude!
-            
-            // Check for distance since last measurement
-            guard currentLocation.distanceFromLocation(location!) > updateDistanceThreshold else {
-                return completionHandler(latitude: latitude!, longitude: longitude!, status: .DISTANCE, error: nil)
-            }
-            
-            // Check for time since last measurement
-            guard lastUpdate == nil || fabs((lastUpdate?.timeIntervalSinceNow)!) > updateTimeintervalThreshold else {
-                return completionHandler(latitude: latitude!, longitude: longitude!, status: .TIME, error: nil)
-            }
-            
-            NSNotificationCenter.defaultCenter().postNotificationName(kLocationUpdated, object: nil)
-            
-            NSUserDefaults.standardUserDefaults().setObject(NSDate(), forKey: kLastLocationUpdate)
-            NSUserDefaults.standardUserDefaults().setDouble(self.latitude, forKey: kLastLocationLatitude)
-            NSUserDefaults.standardUserDefaults().setDouble(self.longitude, forKey: kLastLocationLongitude)
-            
-            completionHandler(latitude: self.latitude, longitude: self.longitude, status: .OK, error: nil)
-        }
-    }
- 
-    public func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
-        
-        manager.stopUpdatingLocation()
-        
-        while locationCompletionHandlers.count > 0 {
-            
-            guard let completionHandler = locationCompletionHandlers.removeFirst() else {
-                return
-            }
-        
-            completionHandler(latitude: latitude, longitude: longitude, status: .ERROR, error: error)
-        }
-    }
-    
     public func locationManager(manager: CLLocationManager, didChangeAuthorizationStatus status: CLAuthorizationStatus) {
         
         self.handleLocationStatus(status)

        self.googleAPIResultType = googleAPIResultType
        self.updateDistanceThreshold = updateDistanceThreshold
        self.updateTimeintervalThreshold = updateTimeintervalThreshold
        self.initWithLastKnownLocation = initWithLastKnownLocation
    }
    

    
    public func updateLocation(completionHandler :LocationCompletionHandler) {
        
        let lastUpdate = NSUserDefaults.standardUserDefaults().objectForKey(kLastLocationUpdate) as? NSDate
        
        guard lastUpdate == nil || fabs((lastUpdate?.timeIntervalSinceNow)!) > updateTimeintervalThreshold else {
            return completionHandler(latitude: self.latitude, longitude: self.longitude, status: .TIME, error: nil)
        }
        
        let operation = LocationUpdateOperation()
        operation.delegate = self
        operation.locationCompletionHandler = completionHandler
        operation.requestLocation(accuracy: self.desiredLocationAccuracy)
        
        operations.addOperation(operation)
    }
    
    public func reverseGeocodeLocation(type :ReverseGeoCodingType = .APPLE, completionHandler :ReverseGeocodeCompletionHandler) {
        
        self.reverseGeocodingCompletionHandler = completionHandler
            
        self.updateLocation { (latitude, longitude, status, error) in
            
            guard error == nil else {
                return completionHandler(country: "", state: "", city: "", reverseGecodeInfo:nil, placemark:nil, error:error)
