Take endpoint from environment instead of argument