added 'ping' method to make sure the server exists and is alive