Make it Symfony 2.2 friendly, use json for transfer to client