Service code for update and create post