Fix issues with search and api after refactor.