Added API factory which returns an appropriate API object based on a version number