Re-did this to make it a bit DRYer and display a meaningful message when it can't reach the server.