updated api call and added output files