REST implementation
clean up for angular scopes