port existing calls to new query API