passing database object to routes