server functionality for chat completed