do a better check for JSON ajax request