Added improvements to JSON API to make it easier for clients to parse the responses