modify test case for higher code coverage
add checking on the 'errors' property from the api response to prevent "Undefined property" warning