Fix some errors in megasearch api use