Adding code to initialise DocumentStore and base controller to manage sessions