Modified the code using request.env object.
Merge pull request #53 from ma2gedev/use-request-env

Use request.env instead of env.