MOBILE-783 messages: Relocate code and functions

Create new getMessages API function