Added REST api for creating and editing posts