Fixed metadata response according to spec, implemented get-request wait function