adapt Message Api to nNewMessage parameter
split thread and message Api in distinct packages