Added functionality for choosing api version