the backend REST service code with mongo