def METHOD_NAME(payload, organization):
    try:
        app_id = payload["appid"]
        delete_application_from_db(app_id, organization)
        response = Response(status=200)    
    except Exception:
        logger.exception("Error occurred when deleting an application")
        response = Response(status=500)
    return response