Rob: check status code instead of curl return code