Fix example for using middlewares

Added the missing variables, and fixed the call to the adapter for generating the response.