Changed architecture to support api versions