json and ajax

added the codes for ajax and json