Fixed routing issue for API

Also worked on making code a bit more multithreading friendly for IoC
and Logging.
Minor updates/fixes for QueryProvider class in ORM.