Add methods to detect whether request was AJAX request or not.