The code which powers the API.