Some APIs don't always return valid JSON if there's an error, usually better to wrap in a try/rescue block.