Fixed a bug in the DB functions. Added ajax libs