Properly handling errors in apiParser and tests now passing.