Move API to separate controller