Converted to controllers instead of mashing everything in api.php