Implementing query.
Refactoring.
Change query api design.
Implement bucket query.
Fixing bucket query impl.
Fix bucket query implementation.