Swap order of if's to allow for exceptional handling of 500 errors
Merge pull request #1 from mlopes/feature/Fix-500s

Swap order of if's to allow for exceptional handling of 500 errors