get($api_class); } catch (ServiceNotFoundException $e) { throw new \Exception(__('Invalid API version.', 'mailpoet')); } } private static function checkContainer() { if(!self::$container) { throw new \Exception(__('Api was not initialized properly. Is MailPoet plugin active?.', 'mailpoet')); } } }