Separated Angular logic by putting the controller in a different file and adding a service that interacts with the Node API