Add support for getting the attachments information using the API
Fix the way we write a compressed stream