Fix compatibility with res.json()