Fixing ajax reference and 'fetch' method