service to grab ajax events from the backend
reference to the service added
refactored controller to grab the events from the angular service