Updated: moved the script getGraphData to an action of GraphsController