refactor interface to register an endpoint and add handlers to that