Change the  MainController to be a service to illustrate how to use a service as a controller