Remove api r2 leftover code

Have a better error message