add a test for as_json