Changes to discovery: raise errors on fail, return format
Initial consumer
Don't request discovery twice
Fix import in integration test
Improve tests