created service for angularjs app