[Change] query api refactoring
[Add] unit test for RestQueryConsumer