Move api urls to constants
Move row creating logic out of the controller