Add buttons to view template
Deal with inconsistencies in JS data