adapt the query endpoint