Made the bukget api compatible with py2 in addition to py3