Refactoring for multiple enpdoints, registering the EndpointProvider and single appContext