Converted borrowed API Controller to Swift