Refactored merging of  out of build_url
Added test for scheme in API URL
Added test for host in API URL