fixes to and query API methods