check for errors in cURL

built in check for errors