init functions to start and stop server