Separate out functionality

Separate out controllers and services into their own files