updated a docstring to conform to best practice and fixed the validation in the RequestHandler.write  to be reached sooner