endpoint is now optional
fixed support for optional endpoint