Fixed a bug where endpoint was being set instead of region.

Endpoint should be changed based on region, moved endpoint configuration out of scope of public facing functions.