adding db methods and moving Messages to DataHandler