fixes object of undefined and catches the case when a generic API error message is present in the response
fixes object of undefined and catches the case when a generic API error message is present in the response

fbshipit-source-id: 9a3606a

exponent/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponent/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,exponentjs/exponent,exponent/exponent,exponent/exponent