changes AJAX calls to use JSON encoding that is interpreted with JavaScript