Fixes to the API and search function