split out server init, and handle errors

oh hi pretty 80lines terminal, this should make you happy.

Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>