Adding createOrUpdate method and tests