first draft of query api