Organized my controller code

I'm still trying to make the api connection to work