Break up API rendering function