Spike for a new API for declaring endpoints

It could work, for now I did just minimal changes to how the endpoint could be defined.