Implemented add and get messages DB functions.