Fix API version detection