Significantly Condensed API Code

Instead of having 12 different functions, everything now works within a single route.