Adding API to cancel all pending queries