             ]
 
             let error = NSError(domain: HeimdallErrorDomain, code: HeimdallErrorNotAuthorized, userInfo: userInfo)
-            completion(Result(error: error))
+            completion(.Failure(error))
         }
     }
 }

                    ]

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

                    requestAccessToken(grant: .RefreshToken(refreshToken)) { result in
                        completion(result.analysis(ifSuccess: { accessToken in
                            let authenticatedRequest = self.authenticateRequest(request, accessToken: accessToken)
                            return .Success(authenticatedRequest)
                        }, ifFailure: { error in
                            if [ HeimdallErrorDomain, OAuthErrorDomain ].contains(error.domain) {
                                self.clearAccessToken()
                            }
                            return .Failure(error)
                        }))
                    }
                } else {
