Refactored to remove global variables
Moved endpoints to subfolder
New application structure to make it simpler with less code and follows gocraft/web design with Middlewares