Refactored the JS Object to be an Angular service