Use mongoose for api