Add an additional check for undefined API results