Adding dependency injection to chatserver