Added ajax call to load graph
Merged into Diogo's and Mandy's changes