raise 400 if payload is not JSON
use preinstalled urllib2 instead of requests
So that this script can be used out of the box without needing pip install requests