Add query handler.