add mindmap function
encode categories in JSON