-cleanup code
-use AngularJS resource for REST