Added JSON and AJAX detection functions for RESTful applications