updates graph controller to work with new database structure