Integrate gui login with server code