Add docstrings and use existing endpoint_url()