fix api tests, fix message.state is always nil on retrieval