add query to api