updated api to allow multiple inputs