Added more unit tests and some input validation for the request variables.