Database integration

added new classes and db classes.