Fix bug related with pagination

There was a bug which avoided to render the errorCode with "details=on". Render methods have been modified and also some unit tests that were broken with the modifications.
Same as in previous comment... details=on breaks the rule of "exactly one" in that particular case.