added model documentation and added general insert into database function