added server logic and main chat interface