Add /rec/closeserver to API to provide a REST method to close the server.