messages: general refactoring, fixes and improvements

* General refactoring and improvements including methods cleanup,
  API additions, oauth fix in REST, docstrings fixes.

Signed-off-by: Konstantinos Kostis <konstantinos.kostis@cern.ch>