Add unit test for monitoring API.