Restore DBS Url in CouchDB

Also fix the issues with the DBSUrl and the clone API. @zdenekmaxa please review.

Fixes #4498