Add evenements/[tag]/json.

Refactor some functions.