Sort branches when in JSON format