BS-11032 update the REST API
BS-11318 : For the monitoring, need to display the number of failed process instances by process definition

- Modify the fillCounters method of the APIProcess to fill the number of the failed cases
- Add unit tests
- Modify the CaseDatastore to count the number of the process instance corresponding to the filters
- Fix the search of the process instance in CaseDatastore to be able to filter on state and (on user or on supervisor) in same time, and when filter on error state, search all process instances (and not just the root)