implement the genotype rest api.