Fixed the database code, added addSession and addSessionType methods