Start of rewrite using the requests library and json