REST api done for messages and relationships