fixed JSON rendering; added extra check when render() and renderError return xhp rather than :base:layout