Add support for custom HATEOAS

Changed the code in order to don't overwrite in document '_self' and 'self' if they don't exists.