Broke down /api/record into a series of modules and reusable libraries.