I wonder whether we should give the AppStates instance an opportunity to put the app into an error state and avoid shutting down the API without returning a response?