added initById and associated tests.