Fix TaskObserver for json endpoint usage.

Testing Done:
The `/j/task?task_id=id1,id2,...` endpoint now works.

Reviewed at https://reviews.apache.org/r/23211/