implemented type-casting for api/viewFavorites