Convert entities to string in mock/test mode.

This makes responses in mock/test mode consistent with API, when
entities are passed as integers.