implement the JSON parser from https://github.com/gebner/lean4/tree/server by @gebner using new Lean 4 syntax and fix some minor bugs.