Made editPatients work with $http requests