I wish as_json were better