api changes to work with angularjs