added error checking through requests.raise_for_status()