Add json parsing and buffered output