updated api and added initial summarize function