Implement save & add entity function
Merged from master