Transparently, efficiently and securely invoke remote or local service methods with strict API definition for Node and Browser