Added error handling code in the API fetch to prevent invalid JSON from quitting the bot