Add a service to encapsulate all the ajax logic