Remove ajax request out of controller into a service