replace python request with ajax