Added exit with curl return code

Check exit status when called from other scripts