modified api_raf & api_rer