how to check if json api is properly formated code example
Example: check if the data can be parsed javascript
function isJson(str) {
try {
return JSON.parse(str);
} catch (e) {
return false;
}
}