fixed json parser and formatter