updated getLibraryByUserId

and home query