Improvements to JSON API.