Add an API to terminate the crawl