modify handlers to accept query string

We should perhaps raise an appropriate error here if ``query`` is not None since we don't currently support it?