added the run/stop function for angular api