implemented some of the controller tests
Changed the api handling