make_json: reimplement everything