If  requests.get failed then res is in uninitialized state and res.status_code != 200 raises an error
Add return to except block to exit after error