Updated code for API searches