Close db after request
Adds upload to S3 option
Get target filename from env
Remove saving to DB, add better logging