Fixing ajax bug where the return was a full html doc