convert proxy object to string before passing to urllib
check if hash is a base-16 string
CORS middleware must return bytes
simplify JSON response