some error handling and docstrings in chatserverfactory