added support to use different S3 endpoints than AWS