(#667) - new get/removeAttachment API and fix / encoding