restructuring the server-side
implemented mongodb first collection