fix in-memory server and demo code