fix json output in controller, now it lists attachments as it should (no preview though).