New API methods for queries.