DB insert/update method implemented