Added cluster pending tasks api.
Closes #3368