added log() to api endpoint