Basic query api implemented