Changes to new Endpoints and cleans up code