Fixed deprecation of status_code.
cleaned up code formatting.