Currently if an API URL that does not exist is requested, an html page is returned instead of JSON

**Apache Airflow version**:2.0

**What happened**:
Making a request against an endpoint that does not exist returns an html page

**What you expected to happen**:

I expected it to return 404 error in JSON indicating that the URL was not found

**How to reproduce it**:
1. Start airflow website and scheduler in breeze.
2. Make a request against an endpoint that does not exist e.g http://localhost:28080/api/v1/getconnectiond
3. Notice that an html page is returned instead of a json
cc: @mik-laj 

airflow/www/extensions/init_views.py
"""Init main app view - redirect to FAB"""
    from airflow.www.blueprints import routes
    app.register_blueprint(routes)
def init_appbuilder_views(app):
    """Initialize Web UI views"""
    appbuilder = app.appbuilder
    from airflow.www import views
    
    
    appbuilder.session.remove()
    appbuilder.add_view_no_menu(views.DagModelView())
    appbuilder.add_view_no_menu(views.Airflow())
    appbuilder.add_view(
        views.DagRunModelView,
        permissions.RESOURCE_DAG_RUN,
        category=permissions.RESOURCE_BROWSE_MENU,
        category_icon="fa-globe",
    )
    appbuilder.add_view(
        views.JobModelView, permissions.RESOURCE_JOB, category=permissions.RESOURCE_BROWSE_MENU
    )