Fix generated url to widget content.
Detect JSON error responses as well.