@main.app_errorhandler(500)
def internal_server_error(e):
    """
    Handle 500 Internal Server errors in html and json
    """