add request validation and error responding