Refactor the API, add new documentation, and add tests for the stop method.