[api] Adjusted SQL for project accessibility