                         let error = NSError(domain: APIKitErrorDomain, code: 0, userInfo: userInfo)
                         return failure(error)
                     }
-                    
-                }
+                }
+
                 dispatch_async(mainQueue, { handler(mappedResponse) })
             }
             

            return nil
        }
    }
    
    // MARK: - NSURLSessionTaskDelegate
    // TODO: add attributes like NS_REQUIRES_SUPER when it is available in future version of Swift.
    public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError connectionError: NSError?) {

                
                let statusCode = (URLResponse as? NSHTTPURLResponse)?.statusCode ?? 0
                if !contains(self.acceptableStatusCodeRange, statusCode) {
                    var error: NSError = {
                        switch self.responseBodyParser().parseData(data) {
                        case .Success(let box): return self.responseErrorFromObject(box.unbox)
                        case .Failure(let box): return box.unbox
                        }
                    }()

                    dispatch_async(mainQueue) { handler(failure(error)) }
                    return
                }
                
