added api interface to handle ajax post and javascript to handle post ajax json return code and actions