Fix bug related with pagination

There was a bug with avoid to render the errorCode with "details=on". Render methods has been modified and also some unit test that were broken with the modifications.