Implement save to database