[api] filter right history elements for search and test it