             },
             remoteFetch: {
                 self.remoteDataManager.userDecks(completion: $0)
-            },
-            remoteDependeciesCount: {
-                return withDependecies ? $0.count : 0
-            }, remoteDependecies: {  objs, dependencyCompletion in
-                for obj in objs {
-                    let flashcards = self.localDataManager.filter(Flashcard.self, predicate: "deckId == '\(obj.serverID)'")
-                    if flashcards.isEmpty {
-                        self.flashcards(obj.serverID) { _ in
-                            dependencyCompletion()
-                        }
-                    } else {
-                        dependencyCompletion()
-                    }
-                }
             }, completion: completion)
     }
 

            },
            remoteFetch: {
                self.remoteDataManager.deck(deckID, completion: $0)
            },
            remoteDependecies: { obj, depenedencyCompletion in
                self.flashcards(obj.serverID) { _ in
                    depenedencyCompletion()
                }
            }, completion: completion)
    }


    // localFetch - blok powinien zwrócić dane z lokalnej bazy danych
    // remoteFetch - blok powinien zawołać przekazany blok z danymi z serwera
    // remoteParsing - blok przyjmuje dane typu, który przychodzi z serwera i powinien zwrócić dane typu lokalnego, np. JSON do Deck
    // completion - ten blok jest wołany z obiektem typu lokalnego, np. Deck
    private func handleRequest<ServerResponseObject, DataManagerResponseObject>(
        localFetch localFetch: (() -> (DataManagerResponseObject?))? = nil,
                   remoteFetch: ((ServerResultType<ServerResponseObject>) -> ())->(),
                   remoteParsing: (obj: ServerResponseObject) -> (DataManagerResponseObject?),
                   completion: (DataManagerResponse<DataManagerResponseObject>) -> ()) {

        remoteFetch { response in
            switch response {
            case.Success(let object):
                if let parsedObject = remoteParsing(obj: object) {
                    completion(self.updateInLocalDatabase(parsedObject))
                    
                } else {
                    completion(.Error(obj: NewDataManagerError.JSONParseError))
