return json for xhr request not a redirect