Same json formatting in java and js.