api/server: Fix remote search server when using memory backend
It can be useful to use a remote search server using the memory backend,
for instance in the docker environment to avoid spawning a costly
elasticsearch instance.
As this was never tested, there was an issue when trying to start
such remote search server so fix it and add tests.