refactor errors management and retrieving of objects in management api