Add multithreading client-server logic