[api] fix invalid backend query

avoid 404 project '#<Project:0x0000000772af18>' does not exist