routing and validation for basic queries