parse turns query into an object