Make sure that we reset cpo on error
Added automatic api version tracking