Callback: only return JSON on failure