Make minimal changes to api to get data out of mongodb.