new method to Validate Query

api now validates queries
returns error if validation fails
boolean query does sanity check now