Added server functionality for chat