code for snapshot management

code for snapshot management. work in progress
This line is too long, please flake8 this PR