Introducing array as return type

Okay, this one should do the trick :-)
You are duplicating code here … use the value of `status` (which can be null) to determine if the response contains an error.