api.py: Added some log functions.