add support for ajax and json