pat: PathPrefix -> Path
json: check null value before writing