parse params, prep a query