[api] Added resource.invoke helper for uniformly calling resource methods from outside interfaces.