Passes in ids and queries using ids