Updated module to take into account different API versions