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.
Perhaps the release could wait until right after the render method is called