fix for querying api

This resolves issue #1