         request.setValue("application/json", forHTTPHeaderField: "Content-Type")
         request.httpBody = jsonData
         request = authenticate(request)
-        print("PUT to \(url) -> \(request)")
+        print("RCHttp: PUT to \(url) -> \(request)")
         
         let session = URLSession(configuration: URLSessionConfiguration.ephemeral)
         task = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in
             
-            guard let httpStatus = response as? HTTPURLResponse, let data = data, error == nil else {
-                print("PUT to \(url) -> \(error!)")
+            print("RCHttp: PUT to \(url) response: \(String(describing: response))")
+            guard let response = response as? HTTPURLResponse, let data = data, error == nil else {
+                print("RCHttp: PUT to \(url) -> \(error!)")
                 failure(error!)
                 return
             }
-            print("PUT to \(url) response: \(String(data: data, encoding: .utf8) ?? "") -> status code = \(httpStatus.statusCode)")
-            success(data)
+            print("RCHttp: PUT to \(url) response: \(String(data: data, encoding: .utf8) ?? "")")
+            success(response, data)
         })
         task!.resume()
     }

        request.setValue("application/json", forHTTPHeaderField: "Content-Type")
		request.httpBody = jsonData
        request = authenticate(request)
        print("POST to \(url) -> \(request)")
		
		let session = URLSession(configuration: URLSessionConfiguration.ephemeral)
		task = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in
			
            guard let httpStatus = response as? HTTPURLResponse, let data = data, error == nil else {
                print("POST to \(url) -> \(error!)")
                failure(error!)
                return
            }
            print("POST to \(url) response: \(String(data: data, encoding: .utf8) ?? "") -> status code = \(httpStatus.statusCode)")
            success(data)
		})
		task!.resume()
	}
	
    //mark: put data sync and async
    
    public func put (at path: String, parameters: [String: Any], success: @escaping (Data) -> Void, failure: @escaping (Error) -> Void) {
        
        let fullPath = baseURL.appendingPathComponent(path).absoluteString.removingPercentEncoding!
        let url = URL(string: fullPath)!

    }
    
    /// Do a GET request
    public func get (at path: String, success: @escaping (HTTPURLResponse, Data) -> Void, failure: @escaping (Error) -> Void) {
        
        let fullPath = baseURL.appendingPathComponent(path).absoluteString.removingPercentEncoding!
        let url = URL(string: fullPath)!
        var request = URLRequest(url: url)
        request.httpMethod = "GET"
        print("RCHttp: GET from \(url) -> \(request)")
        
        // Authenticate
        request = authenticate(request)
        
        task = URLSession.shared.dataTask(with: request) { data, response, error in
            print("RCHttp: GET from \(url) response: \(String(describing: response))")
            guard let response = response as? HTTPURLResponse, let data = data, error == nil else {
                print("RCHttp: GET from \(url) -> \(error!)")
                failure(error!)
                return
            }
            print("RCHttp: GET from \(url) data: \(String(data: data, encoding: .utf8) ?? "")")
            success(response, data)
        }
        task!.resume()
    }
	
	/// Do  a post request
    public func post (at path: String, parameters: [String: Any], success: @escaping (HTTPURLResponse, Data) -> Void, failure: @escaping (Error) -> Void) {
        
        let fullPath = baseURL.appendingPathComponent(path).absoluteString.removingPercentEncoding!
        let url = URL(string: fullPath)!
