Fix as_json to pass the specs