Fix csrf and requests

This fixes issue #1 and also corrects a problem with the usage of python-requests.