update store.server.js basing on feedback and add tests