[~] move server code into lib/helpers