catching possible malformed API responses