working codebase with ajax call