Update api.rst

Changes made to the API. And detailed documentation about the JSON object.