                     ]
 
                     let error = NSError(domain: HeimdallErrorDomain, code: HeimdallErrorInvalidData, userInfo: userInfo)
-                    completion(Result(error: error))
+                    completion(.Failure(error))
                 }
             } else {
                 switch OAuthError.decode(data!) {
                 case let .Success(error):
-                    completion(Result(error: error.nsError))
+                    completion(.Failure(error.nsError))
                 default:
                     let userInfo = [
                         NSLocalizedDescriptionKey: NSLocalizedString("Could not authorize grant", comment: ""),


        httpClient.sendRequest(request) { data, response, error in
            if let error = error {
                completion(Result(error: error))
            } else if (response as! NSHTTPURLResponse).statusCode == 200 {
                switch OAuthAccessToken.decode(data!) {
                case let .Success(accessToken):
                    self.accessToken = accessToken
                    completion(Result(value: accessToken))
                default:
                    let userInfo = [
                        NSLocalizedDescriptionKey: NSLocalizedString("Could not authorize grant", comment: ""),

                    ]

                    let error = NSError(domain: HeimdallErrorDomain, code: HeimdallErrorInvalidData, userInfo: userInfo)
                    completion(.Failure(error))
                }
            }
        }
