Update API and add some documentation