Added a method to get the endpoints from a user
Simplified endpoints collecting code