Added decorator to produce structured response

@czue 
http://manage.dimagi.com/default.asp?131002
small point but i think you can just `return f(request, *args, **kwargs)` in the try block. anyway, this looks good to me, i'll let @millerdev merge when he's happy