use nullptr not NULL in C++
use server_free to release a server to prevent memory leaks and use bool where sensible
build as C++