creating main function to run server application