safer api + implemented basic search design