Reworked storage of summary. Added HTML and JSON output