REST API and MongoDB stack layers