Added OAUTH2 support and did preparations for ng-resource