Updated spell logic and API usage