Add simple error handling and exit for the curl part of things.