export threads to json
added attachment support