Hardening server. Catching exceptions and adding a repl