Fixed object to string conversion error caused by inconsistent API response