Refactoring of JSON server
Put code back to being async and use basic counter pattern