now adding server communicating code in this project