add api key authentication
add a log handler for clients