API changes to create working connection with angularjs