New pattern for loading endpoints. More tests and fixes in various functions