Fixed a bug to prevent the API to crash when it encountered an unexpected JSON format.