fix res api for autodetection