Updated queries to work with new rest interface