Check for error key before parsing payload
Reorganize if statement
Merge pull request #81 from rserna2010/parsing_500_errors

Check for error key before parsing payload