Implement db helper and storing messages in db