         }
     }
 
-    func logout() {
-        logout(success: { () -> Void in
-            // get run for every time a sucessful scope logs out
-            }) { (error) -> () in
+    func logoutThenDeleteAllStoredData() {
+        cancelAllRunningTasks { () -> Void in
+            self.logout(success: { () -> Void in
+                // get run for every time a sucessful scope logs out
+                }) { (error) -> () in
                 // gets run for every failed request
+            }
         }
     }
 

            POSModelManager.sharedManager().deleteAllObjects()
            POSFileManager.sharedFileManager().removeAllFiles()
        }




    }

    func downloadBaseEncryptionModel(baseEncryptionModel: POSBaseEncryptedModel, withProgress progress: NSProgress, success: () -> Void , failure: (error: APIError) -> ()) {


    */
    private func logout(#success: () -> Void, failure: (error: APIError) -> ()) {
        let rootResource = POSRootResource.existingRootResourceInManagedObjectContext(POSModelManager.sharedManager().managedObjectContext)
        if rootResource == nil {
            success()
