Generic API for extern c usage of server.
Added reading and writing to in memory server.