controller and API classes

combine classes, fix code, apply SNA on real (small) GitHub database