Reduce complexity of functions in api EditEntity

Change-Id: Iac727eb93f2e81d5f51343740fa8dcd0a48160d2