'Exits the application with the provided code.
It also waits until all app threads end.'

def __exit(self, exit_code=0):

    model.api.log('Closing    Faraday...')
    model.api.devlog('stopping    model    controller    thread...')
    model.api.stopAPIServer()
    restapi.stopServer()
    self._model_controller.stop()
    self._model_controller.join()
    self.timer.stop()
    model.api.devlog('Waiting    for    controller    threads    to    end...')
    return exit_code
