Refactoring update/create api response