Added functions to create and update records. They need further work.