Loading a branch and send it as JSON
some refactor in js