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.
Fixed in 87ee69d (the issue about checking about empty response vector AND unfilled errorCode).