updated: now passing query through ParseQuery to escape table names properly and also simplified code for getProjects