Some haxx for if we use a java api. fails over to python api.