Move JS side closer to proper GenServer API