This seems like a really odd place for the ID calculation. What does it have to do with getAll, and why do you need to rerun the whole maxId check every time you call it? I feel like that part of the block should be down in `generateId` or similar, and this can just return the server cards or local cards.