If server is down, print a helpful error. Free 'val' from main()