main structure. generate id works. todo: service