api.py works with /train