add a json api for posts