Correct the query api