added controller to main and created OPTIONS endpoint