Implement query api

Query api can be used to efficiently search a group of keys in sorted order