Added res.type(application/json)