<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _close_app(app, mongo_client, client):
 """ Ensures that the app is properly closed """

    app.stop()
    client.close()
    mongo_client.close()