add support for ajax and json
add support for ajax and json