Refactored create and add vote method for posts.