Add API for canceling

Signed-off-by: Jai Govindani <jai@zodio.com>