modified api for scanning