API: Added check whether token exists to core functions