             
             }, completionHandler: { (result, urlResponse) -> Void in
                 
-                switch result {
-                case .Success(let data):
-                    
-                    do
-                    {
-                        let jsonObject = try NSJSONSerialization.JSONObjectWithData(data, options: [])
-                        completionHandler(result: .Success(jsonObject))
-                        
-                    } catch let error as NSError
-                    {
-                        if error.code == 3840, // Invalid JSON format, may be straight text
-                            let decodedErrorString = NSString(data: data, encoding: NSUTF8StringEncoding) {
-                            
-                                let decodedError = NSError(description: decodedErrorString as String)
-                                completionHandler(result: .Failure(decodedError))
-                            
-                        } else {
-                            completionHandler(result: .Failure(error))
-                        }
-                    }
-                    
-                    break
-                    
-                case .Failure(let error):
-                    completionHandler(result: .Failure(error))
-                    break
-                }
+            self.handleJsonTaskCompletion(result, completionHandler: completionHandler)
         })
     }
 }

            return nil
        }
        
        let urlRequest = NSMutableURLRequest(URL: url, cachePolicy: cachePolicy, timeoutInterval: timeoutInterval)
        urlRequest.setValue("text/plain", forHTTPHeaderField: "Content-Type")
        
        urlRequest.HTTPMethod = self.dynamicType.httpMethod
    
        if self.httpBody != SubclassShouldOverrideString
        {
            if let bodyData = self.httpBody.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
            {
                urlRequest.HTTPBody = bodyData
                urlRequest.setValue("\(bodyData.length)", forHTTPHeaderField: "Content-Length")
            }
        }
        
        if let configureUrlRequest = configureUrlRequest {
            configureUrlRequest(urlRequest: urlRequest)

        
        return urlSession.dataTaskWithRequest(urlRequest, completionHandler: { (data, urlResponse, error) -> Void in
            
            self.handleDataTaskCompletion(data, urlResponse: urlResponse, error: error, completionHandler: completionHandler)
        })
    }
    
    internal func handleJsonTaskCompletion(data : SuccessResult<NSData>, completionHandler : JsonTaskCompletionHandler) {
        switch data {
        case .Success(let data):
            
            do
            {
                let jsonObject = try NSJSONSerialization.JSONObjectWithData(data, options: [])
                completionHandler(result: .Success(jsonObject))
                
            } catch let error as NSError
            {
                if error.code == 3840, // Invalid JSON format, may be straight text
                    let decodedErrorString = NSString(data: data, encoding: NSUTF8StringEncoding) {
                        
                        let decodedError = NSError(description: decodedErrorString as String)
                        completionHandler(result: .Failure(decodedError))
                        
                } else {
                    completionHandler(result: .Failure(error))
                }
            }
            
            break
            
        case .Failure(let error):
            completionHandler(result: .Failure(error))
            break
        }
    }
    
    public func jsonTask(configureUrlRequest : ConfigureUrlRequestHandler? = nil, completionHandler : JsonTaskCompletionHandler) -> NSURLSessionDataTask? {
