Cleaned up file structure for rails backend

The API should function as previously, I just rearranged the files in rails to keep them cleaner, and to stop the need for a separate "api" folder in every subdirectory.