Refactored voting and debugged answer creating ajax