Add list_units
Better error handling