add demo.py and APIError in martin.py