Add caching for autocompletion of rooms and fix database problems