Implemented cancel query service.