connected databases, added ajax

Functional