Add error message and ajax loading of graphs