                                error: error as NSError?)
             if let error = error {
                 let result = JSONResult.failure(error: JSONError.requestFailed(error: error), response: response as? HTTPURLResponse, body: self.body(fromData: data))
-                self.errorCallback(error)
+                JSONRequest.errorCallback(error)
                 complete(result)
                 return
             } else if let httpResponse = (response as? HTTPURLResponse), httpResponse.statusCode == 304, let cachedResponseObj = cachedResponse {


    public static let serviceTripTimeNotification = NSNotification.Name("JSON_REQUEST_TRIP_TIME_NOTIFICATION")

    public var errorCallback: (Error) -> Void = { _ in }

    /* Used for dependency injection of outside URLSessions (keep nil to use default) */
    private var urlSession: URLSession?

                                   error: error as NSError?)
                let result = self.parse(data: cachedResponseObj.data, response: cachedResponseObj.response)
                if let error = result.error {
                    JSONRequest.errorCallback(error)
                }
                complete(result)
            } else {
                let result = self.parse(data: data, response: response)
                if let error = result.error {
                    JSONRequest.errorCallback(error)
                }
                complete(result)
            }
