changed the query api