Migrating to v4

Migrate from API v1/v2/v3 to v4