finished implementing angularjs resource for REST calls, cleaned up and commented code