Source:
<code>public QueryResponse getVariantsByRegion(@PathVariable("regionId") String regionId, @RequestParam(name = "species") String species, @RequestParam(name = "studies", required = false) List<String> studies, @RequestParam(name = "annot-ct", required = false) List<String> consequenceType, @RequestParam(name = "maf", required = false) String maf, @RequestParam(name = "polyphen", required = false) String polyphenScore, @RequestParam(name = "sift", required = false) String siftScore, @RequestParam(name = "exclude", required = false) List<String> exclude, HttpServletResponse response) throws IllegalOpenCGACredentialsException, IOException { initializeQuery(); <START> if (species == null || species.isEmpty()) { <END> response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<VariantEntityRepositoryFilter> filters = new FilterBuilder() .getEvaWsVariantEntityRepositoryFilters(maf, polyphenScore, siftScore, studies, consequenceType ); List<Region> regions = Region.parseRegions(regionId); PageRequest pageRequest = Utils.getPageRequest(queryOptions); List<String> excludeMapped = new ArrayList<>(); if (exclude != null && !exclude.isEmpty()){ for (String e : exclude) { String docPath = Utils.getApiToMongoDocNameMap().get(e); if (docPath == null) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Unrecognised exclude field: " + e); } excludeMapped.add(docPath); } } List<VariantEntity> variantEntities = variantEntityRepository.findByRegionsAndComplexFilters(regions, filters, excludeMapped, pageRequest); Long numTotalResults = variantEntityRepository.countByRegionsAndComplexFilters(regions, filters); QueryResult<VariantEntity> queryResult = buildQueryResult(variantEntities, numTotalResults); return setQueryResponse(queryResult); }</code><technical_language>This extra check is necessary: species is required null</technical_language>

Target:
public QueryResponse getVariantsByRegion(@PathVariable("regionId") String regionId, @RequestParam(name = "species") String species, @RequestParam(name = "studies", required = false) List<String> studies, @RequestParam(name = "annot-ct", required = false) List<String> consequenceType, @RequestParam(name = "maf", required = false) String maf, @RequestParam(name = "polyphen", required = false) String polyphenScore, @RequestParam(name = "sift", required = false) String siftScore, @RequestParam(name = "exclude", required = false) List<String> exclude, HttpServletResponse response) throws IllegalOpenCGACredentialsException, IOException { initializeQuery(); if (species.isEmpty()) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<VariantEntityRepositoryFilter> filters = new FilterBuilder() .getVariantEntityRepositoryFilters(maf, polyphenScore, siftScore, studies, consequenceType ); List<Region> regions = Region.parseRegions(regionId); PageRequest pageRequest = Utils.getPageRequest(queryOptions); List<String> excludeMapped = new ArrayList<>(); if (exclude != null && !exclude.isEmpty()){ for (String e : exclude) { String docPath = Utils.getApiToMongoDocNameMap().get(e); if (docPath == null) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Unrecognised exclude field: " + e); } excludeMapped.add(docPath); } } List<VariantEntity> variantEntities = variantEntityRepository.findByRegionsAndComplexFilters(regions, filters, excludeMapped, pageRequest); Long numTotalResults = variantEntityRepository.countByRegionsAndComplexFilters(regions, filters); QueryResult<VariantEntity> queryResult = buildQueryResult(variantEntities, numTotalResults); return setQueryResponse(queryResult); }