before I have a mess here I will make a small API
outsource this one to the framework
outsource this one to a new file
fix include the API logger now