Adding database operation functions 

Solves issue #2