small refactoring in unique tweet and JSON error handler of 404