Checking cURL error code in api tests