[5.0] Add EndpointTrait

Make `MethodEndpoint` and `ResourceEndpoint ` use `EndpointTrait`.
It would be nice to use the FQCN here.