Add logging for API endpoints

Closes #290