Implement the full example
added comments
added routes
added db handling