Server connection functionality

server main working.