complete the simple frontend and server end code