Update api.py

Adding the ability to post from the API