messages: refactoring and REST API 

Refactoring of the messages module. An api.py file has been created in order to interact with the database. Also a restful.py file has been created so that messages can have a REST API.
1: D400 First line should end with '.', not 'e'
4: I102 copyright year is outdated, expected 2014 but got 2012
39: D205 Blank line missing between one-line summary and description
50: D205 Blank line missing between one-line summary and description
61: D205 Blank line missing between one-line summary and description
77: D401 First line should be imperative: 'Check', not 'Checks'
77: D400 First line should end with '.', not 'e'
77: D205 Blank line missing between one-line summary and description
89: D205 Blank line missing between one-line summary and description
102: D205 Blank line missing between one-line summary and description
121: D290 White spaces around docstring should be trimmed.
121: D400 First line should end with '.', not 'r'
121: D205 Blank line missing between one-line summary and description
134: D290 White spaces around docstring should be trimmed.
134: D400 First line should end with '.', not 'd'
134: D205 Blank line missing between one-line summary and description
145: D400 First line should end with '.', not 'l'
145: D205 Blank line missing between one-line summary and description
165: D400 First line should end with '.', not 'd'
165: D205 Blank line missing between one-line summary and description
176: D400 First line should end with '.', not 'x'
176: D205 Blank line missing between one-line summary and description
191: D401 First line should be imperative: 'Check', not 'Checks'
191: D400 First line should end with '.', not ','
191: D205 Blank line missing between one-line summary and description
212: D400 First line should end with '.', not ')'
212: D205 Blank line missing between one-line summary and description
232: D401 First line should be imperative: 'check', not 'checks'
232: D290 White spaces around docstring should be trimmed.
232: D400 First line should end with '.', not '1'
241: D401 First line should be imperative: 'Update', not 'Updates'
241: D400 First line should end with '.', not 'd'
241: D205 Blank line missing between one-line summary and description
269: D400 First line should end with '.', not 'n'
310: D400 First line should end with '.', not 't'
310: D205 Blank line missing between one-line summary and description
318: D401 First line should be imperative: 'Clean', not 'Cleans'
318: D290 White spaces around docstring should be trimmed.
318: D400 First line should end with '.', not 'e'
377:1: W391 blank line at end of file