Serialize to api.json
Add enum support