Adapt to new JSON API

We now use enums instead of strings