ajax.py get_k function working