fix query to the api