Separate the command fetching and running.
Fix the missing fields errors.
Abstract the repl logic to a class.
Tests for the api repl.
Add and test the 'update' function.