Added error message writer. Request handlers refactored.