Adding S3 adapter
Error handling and other threading improvements