Create an api function for the 'clear errors' cli command and update the test framework to use the new api function.