refactored responses to support python 3