Cave server code.