[TEST] Replaced RestApiParser assertions with exceptions for better error messages