cleaning up the api and starting to use jade templates for the html pages