update package.json and middleware