add attachments_by_type field to JSON