Support infinite TTL
Refactor events out of server file