Fixed and ported to python3

I've fixed the using of api with its version 3 and correct dictionnary keys and urls for the api.