added ability to add resource fields to json output
and added new check for ajax request (without GET parameter)