Added db insert functionality.