modify handlers to accept query string

`max_results` and `query` need to be documented.