Connected server logic to gui