Repeat API call

If an API call fails once, try it a few times because it might return a
proper value later on despite Utilities.sleep(1000)… of course, if
after a few times the response keeps being undefined then it’s likely
that the format we provided is simply wrong, in which case this
terminates the program and alerts the user.