Migrate to JSON api