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 2011
40: D401 First line should be imperative: 'Check', not 'Checks'
98: D202 No blank lines allowed *after* function docstring, found 1
121: D290 White spaces around docstring should be trimmed.
139: D290 White spaces around docstring should be trimmed.
228: D401 First line should be imperative: 'Check', not 'Checks'
306: D401 First line should be imperative: 'take', not 'takes'
306: D290 White spaces around docstring should be trimmed.
306: D400 First line should end with '.', not 's'
361: D401 First line should be imperative: 'take', not 'takes'
361: D290 White spaces around docstring should be trimmed.
361: D400 First line should end with '.', not 's'
391: D290 White spaces around docstring should be trimmed.
391: D400 First line should end with '.', not 's'
433: D401 First line should be imperative: 'Create', not 'Creates'
488: D401 First line should be imperative: 'not(i', not 'not(is'
488: D290 White spaces around docstring should be trimmed.
488: D400 First line should end with '.', not ')'
529: D401 First line should be imperative: 'Update', not 'Updates'
563: D400 First line should end with '.', not 'n'
605: D400 First line should end with '.', not 't'
614: D401 First line should be imperative: 'Clean', not 'Cleans'
614: D290 White spaces around docstring should be trimmed.
614: D400 First line should end with '.', not 'e'