modify handlers to accept query string

This `query` parameter needs to be documented.