added tests for merge
cleaned up validateUrl logic
fixed promised chaining to be at the same level