Fix issue #2264: endpoints.enabled property does not work

Fix issue #2264: endpoints.enabled property does not work due to missing return statement.
Also add modification to the EnvironmentEndpoint class that not properly
initializes the 'environment' property used by the 'isEnabled' method of
the super class.