AngularJS service implementation JSON RPC 2.0