implement the server function
implement the server function