Fix REST function for /search