add json API to create and edit posts