Refactor post to ng-resource
Refactor delete and put to ng-resource