not a correction but an open question: is it really a good idea to return 0 instead of -1 for error state? I'm not sure if the API returns already 0 value for some situation, that can lead to gaia understanding no-more-retries-available instead of an error.