     
     func query(parameters: [String: AnyObject]) -> String {
         var components: [(String, String)] = []
-        for key in sorted(Array(parameters.keys), <) {
+        for key in Array(parameters.keys).sort(<) {
             let value: AnyObject! = parameters[key]
             components += self.queryComponents(key, value)
         }
         
-        return join("&", components.map{"\($0)=\($1)"} as [String])
+        return (components.map{"\($0)=\($1)"} as [String]).joinWithSeparator("&")
     }
 }

                    rawRequestCompletionHandler(json: nil, responseError: NSError(domain: "GeneralHTTPError", code: httpResponse.statusCode, userInfo: nil))
                }
            } else {
                rawRequestCompletionHandler(json: nil, responseError: NSError(domain: error.localizedDescription, code: error.code, userInfo: error.userInfo))
            }
        })
        task.resume()


    func request(methodName : String, endpointName: String, token: AnyObject?, params: AnyObject?, requestCompletionHandler: (json: AnyObject?, responseError: NSError?) -> Void) {
         if let t : String = token as? String {
            let ts = NSDate().timeIntervalSince1970
            let tosign = "/2/\(endpointName)||\(ts)"
            let hmac = tosign.hmac(.SHA512, key: t)
            let extraParams = "?signature=\(hmac)"
            print("To Sign: \(tosign) signed: \(hmac)")
            rawRequest(methodName, urlString: KuggleAPI.baseURL() + endpointName + extraParams, headers: ["Token": t, "Nonce": "\(ts)"], params: params, rawRequestCompletionHandler: {json, error -> Void in
                if error == nil {
                    let meta = (json as! NSDictionary)["meta"] as! NSDictionary
                    let metaCode = meta.objectForKey("code") as! NSInteger
