adding code to api2.py,