Added containsFavorite() to check if an item with the given id already exists in the favorites list