Move defections functionality to its own class.
Use a before block for common code.
Use Sinatra namespace for data API routes.
Specify encoding.
Remove commented code.
Explicitly inject model dependencies into Api instances.