Added <addall> to function which takes a json array and adds all the functions