added shutdown capability. Using gevent.event.Event
also - the shutdown messages is showed via Flask view.
this is needed to provide a graceful shutdown.