centralized api return helper