adding query to api