changed as_json from History property to plain function