                         client.URLProtocolDidFinishLoading(self)
                     }
                     
-                    if error == nil || error.code == 0 {
-                        if let json = NSString(data: data, encoding: NSUTF8StringEncoding) { // We try to decode the `JSON` response
-                            if let url = connection.currentRequest.URL {
-                                let error = NSErrorPointer()
-                                if let docsURL = NSFileManager.defaultManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: false, error: error) {
-                                    if let lastPathComponent = url.lastPathComponent {
-                                        let fileURL = docsURL.URLByAppendingPathComponent(lastPathComponent).URLByAppendingPathExtension("json")
-                                        var result: Result<String, NSError>
-                                        if data.writeToURL(fileURL, atomically: true) {
-                                            result = Result.success("Filed saved to \(fileURL.absoluteString)")
-                                        } else {
-                                            let internalError = NSError(
-                                                domain: RecordingProtocol.errorDomain,
-                                                code: -671,
-                                                userInfo: [NSLocalizedDescriptionKey: "Unable to save file \(fileURL.lastPathComponent) to here \(fileURL.absoluteString)"]
-                                            )
-                                            result = Result.failure(internalError)
-                                        }
-                                        
-                                        if let callback = self.operationResult {
-                                            callback(result)
-                                        }
-                                    } else {
-                                        if let callback = self.operationResult {
-                                            let internalError = NSError(
-                                                domain: RecordingProtocol.errorDomain,
-                                                code: -670,
-                                                userInfo: [NSLocalizedDescriptionKey: "Unable to extract the request's last path component for file name generation."])
-                                            callback(Result.failure(internalError))
-                                        }
-                                    }
-                                } else {
-                                    if let callback = self.operationResult {
-                                        var userInfo:[String: AnyObject] = [NSLocalizedDescriptionKey: "Unable to get the «Document»'s directory path"]
-                                        if let memError = error.memory {
-                                            userInfo.updateValue(memError, forKey: NSUnderlyingErrorKey)
-                                        }
-                                        
-                                        let internalError = NSError(
-                                            domain: RecordingProtocol.errorDomain,
-                                            code: -669,
-                                            userInfo: userInfo)
-                                        callback(Result.failure(internalError))
-                                    }
-                                }
-                            }
-                        } else { // We were not able to parse the JSON response
-                            if let callback = self.operationResult {
-                                let internalError = NSError(
-                                    domain: RecordingProtocol.errorDomain,
-                                    code: -668,
-                                    userInfo: [NSLocalizedDescriptionKey: "Unable to correctly parse a `JSON` response for \(connection.originalRequest)"])
-                                callback(Result.failure(internalError))
-                            }
-                        }
-                    } else {
-                        if let callback = self.operationResult {
-                            let internalError = NSError(
-                                domain: RecordingProtocol.errorDomain,
-                                code: -672,
-                                userInfo: [
-                                    NSLocalizedDescriptionKey: "Unable to get a successful response for \(connection.originalRequest).",
-                                    NSUnderlyingErrorKey: error
-                                ])
-                            callback(Result.failure(internalError))
-                        }
-                    }
+                    self.processResponse(response, connection: connection, data: data, error: error)
             }
         } else {
             if let callback = operationResult {

        }
    }
    
   
    
    // MARK: NSURLProtocol
    
    override public var cachedResponse: NSCachedURLResponse? { get { return nil } }
    
    public override class func canInitWithRequest(request: NSURLRequest) -> Bool {
        if let stop = request.valueForHTTPHeaderField(RecordingProtocol.ignoreRequestHTTPHeaderKey) {

                request,
                queue: NSOperationQueue.mainQueue()) {
                response, data, error -> Void in
                    
                    // Try to access the protocol's client
                    if let client = self.client {
                        // Cascade the «messages» to avoid the calling up from being stuck without response
