added a method to get an endpoint from a specific environment