Bug when trying to download attachment (#1310)

Includes refactoring and style fixes.(for `dasein`)
Ref
https://github.com/TheWeatherCompany/grid-api/issues/1310