Capture model errors in modelMiddleware; add error middleware in examples