convert to flask to handle url routing cleaner