                                httpResponse: response as? HTTPURLResponse,
                                error: error as NSError?)
             if let error = error {
-                let result = JSONResult.Failure(error: JSONError.RequestFailed(error: error),
+                let result = JSONResult.failure(error: JSONError.requestFailed(error: error),
                                                 response: response as? HTTPURLResponse,
                                                 body: self.body(fromData: data))
                 complete(result)


    func parse(data: Data?, response: URLResponse?) -> JSONResult {
        guard let httpResponse = response as? HTTPURLResponse else {
            return JSONResult.Failure(error: JSONError.NonHTTPResponse, response: nil, body: nil)
        }
        guard let data = data, data.count > 0 else {
            return JSONResult.Success(data: nil, response: httpResponse)
        }
        guard let json = JSONToObject(data: data) else {
            return JSONResult.Failure(error: JSONError.ResponseDeserialization,
                                      response: httpResponse,
                                      body: dataToUTFString(data: data))
        }
        return JSONResult.Success(data: json, response: httpResponse)
    }

    func body(fromData data: Data?) -> String? {

                            queryParams: JSONObject? = nil, payload: Any? = nil,
                            headers: JSONObject? = nil, complete: @escaping (JSONResult) -> Void) {
        if isConnectedToNetwork() == false {
            let error = JSONError.noInternetConnection
            complete(.failure(error: error, response: nil, body: nil))
            return
        }

