             }, completionHandler: { (response, fileURL, error) -> Void in
                 if let actualError = error {
                     if (error.code != NSURLErrorCancelled) {
-                        failure(error: APIError(error: error))
+                        if self.isUnauthorized(response as? NSHTTPURLResponse) {
+                            OAuthToken.removeAcessTokenForOAuthTokenWithScope(kOauth2ScopeFull)
+                            self.validateFullScope {
+                                failure(error: APIError(domain: Constants.Error.apiClientErrorDomain, code: Constants.Error.Code.UnknownError.rawValue, userInfo: nil))
+                            }
+                        } else {
+                            failure(error: APIError(error: error))
+                        }
                     }
                 } else if let actualFileUrl = fileURL {
-                        success(url:actualFileUrl)
+                    success(url:actualFileUrl)
                 }
                 // we get here if the request was canceled, should do nothing.
         })

        let task = fileTransferSessionManager.downloadTaskWithRequest(urlRequest, progress: nil, destination: { (url, response) -> NSURL! in
            let changedBaseEncryptionModel : POSBaseEncryptedModel? = {
                if isAttachment {
                     return POSAttachment.existingAttachmentWithUri(encryptedModelUri, inManagedObjectContext: POSModelManager.sharedManager().managedObjectContext)
                } else {
                    return POSReceipt.existingReceiptWithUri(encryptedModelUri, inManagedObjectContext: POSModelManager.sharedManager().managedObjectContext)
                }

                    error.responseText = serializedResponse?.description
                    failure(error: error)
                })
            } else if self.isUnauthorized(response as? NSHTTPURLResponse) {
                let error = APIError(domain: Constants.Error.apiClientErrorDomain, code: Constants.Error.Code.oAuthUnathorized.rawValue, userInfo: nil)
                failure(error:error)
            }  else if (response as! NSHTTPURLResponse).didFail()  {
                let err = APIError(urlResponse: (response as! NSHTTPURLResponse), jsonResponse: serializedResponse)
                dispatch_async(dispatch_get_main_queue(), {
                failure(error:err)
