testing document REST enhancements: restructure attachments for future email support
code cleanup and structure