split out server init, and handle errors

Signed-off-by: Niv Sardi <xaiki@evilgiggle.com>