sip - refactoring api errors handling