Some more refactoring. Implemented get_couch_api_base.