Refactor API boxes into partial