Creating an API to answer search queries