added json response
ajax and api