             
             //Try to convert the data stream to a dictionary
             do {
-                json = try NSJSONSerialization.JSONObjectWithData(resultData, options: .MutableLeaves) as! [String: AnyObject]
+                json = try JSONSerialization.jsonObject(with: resultData, options: .mutableLeaves) as! [String: AnyObject]
             } catch {
-                let jsonString = String(data: resultData, encoding: NSUTF8StringEncoding)
-                self.runDelegateProtocolFunction("Error could not parse JSON: '\(jsonString)'", error: jsonString!, url: url)
+                let jsonString = String(data: resultData, encoding: String.Encoding.utf8)
+                self.runDelegateProtocolFunction(printString: "Error could not parse JSON: '\(jsonString!)'", error: jsonString!, url: url)
                 return
             }
             
             if let success = isSuccess {
-                self.runDelegateProtocolFunction("\"\(success)\": \(json[success])", results: json, url: url)
+                self.runDelegateProtocolFunction(printString: "\"\(success)\": \(json[success]!)", results: json, url: url)
             } else {
-                self.runDelegateProtocolFunction("REST call was successful", results: json, url: url)
+                self.runDelegateProtocolFunction(printString: "REST call was successful", results: json, url: url)
             }
             
         })

                    }
                }
                //Must encode the request to HTTPRequest
                request.HTTPBody = postValues.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true)
                //Needed to let the Server know what kind of data that is being sent
                request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
            case .multipartForm:

    func restCall(params : [String: AnyObject], url : String, method: HTTPMethod = HTTPMethod.post, contentType: ContentType = ContentType.json, isSuccess: String? = nil) {
        
        //Checks to see if the URL string is valid
        guard let tempURL = URL(string: url) else {
            self.runDelegateProtocolFunction(printString: "Error: could not create URL from string", error: "", url: url)
            return
        }
        //Creates the session and request
        //let session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
        let session = URLSession(configuration: URLSessionConfiguration.default)
        var request: URLRequest = URLRequest(url: tempURL)
        request.httpMethod = method.rawValue
        do {
            //TODO: Add GET protocols
            switch contentType {
            case .json:
                //Converts the params object to JSON in the HTTP request
                let jsonPost = try JSONSerialization.data(withJSONObject: params, options: JSONSerialization.WritingOptions.prettyPrinted)
                request.httpBody = jsonPost
                request.addValue(ContentType.json.rawValue , forHTTPHeaderField: ContentType.headerFieldValue)
            case .urlEncode:
                //Convert the Dictionary to a String
