make query calls async

extend to include sort