Added test case for malformed JSON payload for /polls, made the error handler return JSON.