Refactor the list and edit controllers to use a resource instead of the repository with $http.