added in html page and started seperation of functionality between UI controller and API controller