Add unit tests for OC_API::mergeResponses and fix error with api returning incorrect status codes.

Contains this branch as well: https://github.com/owncloud/core/pull/5828

Added unit test for mergeResponses();