Add API for stop detection