refactor
add first/last value to timeseries metadata
refactor a bit
formatting
update API doc
prepare Timeseries metadata for reference values