session authentication in tastypie api
setting up csrf token in ajax request
cathching unauthorized error and redirecting to login page