Adds handlers from a different Hug API to this one - to create a single API

def extend(self, http_api, route="", base_url="", **kwargs):
        """Adds handlers from a different Hug API to this one - to create a single API"""
        self.versions.update(http_api.versions)
        base_url = base_url or self.base_url

        for router_base_url, routes in http_api.routes.items():
            self.routes.setdefault(base_url, OrderedDict())
            for item_route, handler in routes.items():
                for method, versions in handler.items():
                    for version, function in versions.items():
                        function.interface.api = self.api
                self.routes[base_url].setdefault(route + item_route, {}).update(handler)

        for sink_base_url, sinks in http_api.sinks.items():
            for url, sink in sinks.items():
                self.add_sink(sink, route + url, base_url=base_url)

        for middleware in (http_api.middleware or ()):
            self.add_middleware(middleware)

        for version, handler in getattr(http_api, '_exception_handlers', {}).items():
            for exception_type, exception_handlers in handler.items():
                target_exception_handlers = self.exception_handlers(version) or {}
                for exception_handler in exception_handlers:
                    if exception_type not in target_exception_handlers:
                        self.add_exception_handler(exception_type, exception_handler, version)

        for input_format, input_format_handler in getattr(http_api, '_input_format', {}).items():
            if not input_format in getattr(self, '_input_format', {}):
                self.set_input_format(input_format, input_format_handler)

        for version, handler in http_api.not_found_handlers.items():
            if version not in self.not_found_handlers:
                self.set_not_found_handler(handler, version)