added db support and history graph