Switch from res.type to res.setHeader