connecting to the server and checking a basic connection