added error support and jquery configuration for csrf token.