Add query support to the API