Implementing some request validation.