split out db into seperate file, add doc controller'