Monitoring API: fix the return codes

409 (conflict): the entry is not in the expected state
404: entry not found