Added input validation/exception handling for server and username.