Make request status function reasonable

By using a dictionary and exception handling instead of lots of if and
elif statements.