update api.py for phpass