adding main function to start server