Added a reset function to the api.
Changed the way the api initiates.