Change method upvote and downvote to a Post method. Refactor search code on a Post to the class Post.
Use Ajax for upvote and downvote function