beginning to implement the query api.