WIP: implement searching API.