Fix json format and minor fixes