Protect API calls for trusted applications (not finished yet)