Make endpoint configurable and key optional