Updated the logic for API hit and now using ng-resource, created a new service for using ng-resource capabilities.