remove extra http call to metadata server and fix tests