refactor server->cleanup and use an enum for return so we know what the values actually mean