Added graphs callback and db function