Fixed voting
Added error check to vote api