I know what JSON is and what the advantages over XML. I already read some answers for this, but still I can't get through it.
So I would specifically ask this questions:
Because from my point of view, if the data, which we need to output not much, why not just directly write on HTML directly, and if it's a lot of data, why not use database? If you don't mind, please add an example case to use JSON.
Because JSON is a lightweight data interchange format, it's uses vary widely. You describe using it for an API, which would be an idea situation to use JSON output over something like XML.
To specifically answer your questions: