     private func handleTextFieldInterfaces(){
         autocompleteTextfield.onTextChange = {[weak self] text in
             if !text.isEmpty{
-                if self!.connection != nil{
-                    self!.connection!.cancel()
-                    self!.connection = nil
+                if let dataTask = self?.dataTask {
+                    dataTask.cancel()
                 }
-                let urlString = "\(self!.baseURLString)?key=\(self!.googleMapsKey)&input=\(text)&sensor=1"
-                let s = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet
-                s.addCharactersInString("+&")
-                if let encodedString = urlString.stringByAddingPercentEncodingWithAllowedCharacters(s) {
-                    if let url = NSURL(string: encodedString) {
-                        let urlRequest = NSURLRequest(URL: url)
-                        self?.connection = NSURLConnection(request: urlRequest, delegate: self)
-                    }
-                }
+                self?.fetchAutocompletePlaces(text)
             }
         }
         

        mapView.addAnnotation(selectedPointAnnotation!)
    }
    
    
    //MARK: Private Methods
    func dismissKeyboard(){
        self.autocompleteTextfield.resignFirstResponder()
    }
}

extension ViewController: NSURLConnectionDelegate {
    //MARK: NSURLConnectionDelegate
    func connection(connection: NSURLConnection, didReceiveResponse response: NSURLResponse) {
        responseData = NSMutableData()
    }
    
    func connection(connection: NSURLConnection, didReceiveData data: NSData) {
        responseData?.appendData(data)
    }
    
    func connectionDidFinishLoading(connection: NSURLConnection) {
        if let data = responseData{
            
            do{
                let result = try NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments)
                
                if let status = result["status"] as? String{
                    if status == "OK"{
                        if let predictions = result["predictions"] as? NSArray{
                            var locations = [String]()
                            for dict in predictions as! [NSDictionary]{
                                locations.append(dict["description"] as! String)
                            }
                            self.autocompleteTextfield.autoCompleteStrings = locations
                            return
                        }
                    }
                }
                self.autocompleteTextfield.autoCompleteStrings = nil
            }
            catch let error as NSError{
                print("Error: \(error.localizedDescription)")
            }
        }
    }
    
    func connection(connection: NSURLConnection, didFailWithError error: NSError) {
        print("Error: \(error.localizedDescription)")
    }
}


        }
    }

    //MARK: - Private Methods
    private func addAnnotation(coordinate:CLLocationCoordinate2D, address:String?){
        if let annotation = selectedPointAnnotation{
            mapView.removeAnnotation(annotation)
