added csrf_token setup for ajax requests and a decorator pattern