updates api to support adding and editing posts