API server (wrapping mongodb)