Catch more JSON errors

And lets keep the debugging middleware in for now...