Fixed bug in json API.