The API is not universally constructed, as it turns out, so some records have keys that are absent from others. I was able to deduce what was going wrong and rewrite the code to accommodate for it thanks to being able to examine the error stacktrace. Thanks for the tip!
Btw, please elaborate on a few of the points you made here when you have a moment to spare, thanks again!