Added API versioning, needs improving but the core concept is there.