most functions with some initial input/output inserted.
focused in on processing ajax requests. heavy-lifting function actually.