Conditional alert of returned JSON