building json and directives WIP