<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def autodiscover():
 """ Perform an autodiscover of an api.py file in the installed apps to generate the routes of the registered viewsets. """

    for app in settings.INSTALLED_APPS:
        try:
            import_module('.'.join((app, 'api')))
        except ImportError as e:
            if e.msg != "No module named '{0}.api'".format(app):
                print(e.msg)