added json parsing of post and ajax call