Add comments to all functions, remove addEndpoint(), add $endpoints variable to __construct()