added additional sizes check for invalid API payload