Implemented db operations for post model