Fixed #181 Add query API support for the ANY or ALL retrieval mode